package com.liner.homework.first;

import java.util.Arrays;

public class Homework {

        public static void main(String[] args) {

            //1. String支持的正则表达式练习：matches()、replaceAll()、split()方法。
            String str = "123123123老师好";
            String regex = "[0-9]+";
            boolean matches = str.matches(regex);
            if (matches) {
                System.out.println("有匹配到 Matches ");

            }else{
                System.out.println("有匹配到 Matches ");
            }

            String s = str.replaceAll(regex, "#NUMBER#");
            System.out.println("练习replaceAll 替换:" + s);

            String inter = "www.liner.com.cn";
            String[] split = inter.split("\\.");
            System.out.println("分割 split 后的数组展示:" + Arrays.toString(split));


            // 2. Object的练习：设计Point类，体会重写toString()与equals()的必要性
            Point point1 = new Point(100, 123);
            Point point2 = new Point(100, 123);
            System.out.println("重写 Point类后的toString方法:" + point1.toString());
            System.out.println("重写 Point类后的equals方法,判断两类是否值一致:" + point1.equals(point2));


            // 3. 包装类的练习：演示包装类与基本类型的互转、演示自动拆装箱、演示包装类的两个常用操作
            String number = "123";
            Double d1 = new Double(123.151);
            double d2 = d1.doubleValue();


            Integer int1 = 12;
            d2 = d1;

            System.out.println("long的最大值" + Long.MAX_VALUE);
            System.out.println("long的最小值" + Long.MIN_VALUE);
            Integer i1 = Integer.valueOf(number);


        }




}
